package com.mowh.multithreading.thread.specific.storage;

import java.io.*;

/**
 * @author mowh1gd
 * @create 2023/11/27 16:48
 */
public class TSLog {//非线程共享的
    private PrintWriter writer = null;

    public TSLog(String fileName) {
        try {
            writer = new PrintWriter(new FileWriter(fileName));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    public void println(String s) {//单线程
        writer.println(s);
    }
    public void close() {//单线程
        writer.println("==== End of log ====");
        writer.close();
    }
}
